package com.example.basic.domain;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 
 * @author majianwei
 */
@Data
@ApiModel("user信息实体")
@AllArgsConstructor
@NoArgsConstructor
@Builder
@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.LEFT)
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.LEFT)
public class User {

    public static final String FIELD_ID = "id";
    public static final String FIELD_NAME = "name";
    public static final String FIELD_AGE = "age";
    public static final String FIELD_SEX = "sex";
    public static final String FIELD_DESCRIPTION = "description";

    @ApiModelProperty(value = "表ID，主键", required = true)
    @ExcelIgnore
    private Integer id;

    @ApiModelProperty("名字")
    @ExcelProperty(value = {"名字", "name"}, index = 0)
    @ColumnWidth(15)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String name;

    @ApiModelProperty("年龄")
    @ExcelProperty(value = {"年龄", "age"}, index = 1)
    @ColumnWidth(15)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer age;

    @ApiModelProperty("性别")
    @ExcelProperty(value = {"性别", "sex"}, index = 2)
    @ColumnWidth(15)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String sex;

    @ApiModelProperty("描述")
    @ColumnWidth(15)
    @ExcelProperty(value = {"描述", "description"}, index = 3)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String description;

}